package org.ykh.service.policy.annotation;




import org.ykh.service.policy.RestrictPolicy;
import org.ykh.service.policy.ShieldRestrictPolicy;

import java.lang.annotation.*;

/**
 * threshold/interval = 请求频率限制
 * @author ykh
 */

@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@Documented
public @interface Shield {

    int interval() default 3;
    String intervalTimeUnit() default "MILLIS";
    int threshold() default  8;
    Class<? extends RestrictPolicy> policy() default ShieldRestrictPolicy.class;
}
